home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / Files / Standard File / StandardGetAlias / Main.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  1.9 KB  |  85 lines  |  [TEXT/CWIE]

  1. /*
  2.  
  3.      File:        Main.c
  4.  
  5.      Contains:    A simple shell that allows the testing of the StandardGetAlias
  6.                  routine.
  7.                  
  8.     Version:    1.0
  9.  
  10.     Copyright:    © 1998-1999 by Apple Computer, Inc., all rights reserved
  11.  
  12.     Technology: Standard File dialogs
  13.  
  14.     Bugs?:        For bug reports, consult the following page on
  15.                 the World Wide Web:
  16.  
  17.                     http://developer.apple.com/bugreporter/
  18.  
  19.     ========================================================================
  20.     You may incorporate this sample code into your applications without
  21.     restriction, though the sample code has been provided “AS IS” and the
  22.     responsibility for its operation is 100% yours.  However, what you are
  23.     not permitted to do is to redistribute the source as “DSC Sample Code”
  24.     after having made changes. If you’re going to re-distribute the source,
  25.     we require that you make it clear in the source that the code was
  26.     descended from Apple Sample Code, but that you’ve made changes.
  27.     ========================================================================
  28.  
  29.     Writers:
  30.  
  31.         (afb)    Andy Bachorski
  32.  
  33.     Change History (most recent first):
  34.  
  35.          <1>      2/9/99    afb        first checked in
  36.  
  37. */
  38.  
  39. //******************    Universal Interfaces        ****************************
  40.  
  41. #include <Dialogs.h>
  42. #include <Finder.h>
  43. #include <Fonts.h>
  44. #include <Menus.h>
  45. #include <Quickdraw.h>
  46. #include <TextEdit.h>
  47.  
  48.  
  49. //******************    Project Interfaces            ****************************
  50.  
  51. #include "StandardGetAlias.h"
  52.  
  53. void main(void)
  54. {
  55.     StandardFileReply    mySFReply;
  56.     
  57.     // init the toolbox
  58.     
  59.     MaxApplZone();
  60.     InitGraf(&qd.thePort);
  61.     InitFonts();
  62.     InitWindows(); 
  63.     InitMenus();
  64.     TEInit();
  65.     InitDialogs(nil);
  66.  
  67.     //    Call the get folder routine, passing in our file filter
  68.     
  69.  
  70.     StandardGetAlias( &mySFReply );
  71.         
  72.     // MacsBug is indeed the best UI for reporting results
  73.     /*
  74.         if (mySFReply.sfGood)
  75.         {
  76.             DebugStr(mySFReply.sfFile.name);
  77.             
  78.             if (mySFReply.sfIsVolume) DebugStr("\p is a volume");
  79.         }
  80.         else
  81.         {
  82.             DebugStr("\p cancelled");
  83.         }
  84.     */
  85. }